UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p6atEJADSNhtPHDUQyiiIKc4XRV7a9f3j/MLhPnfzXk=' 
WHERE 
  key_id = 'aa57edcc25a948ac9e46cb0aef1321a8ef568e79960f75505183a030adb107e3' 
  AND (
    token = 'p6atEJADSNhtPHDUQyiiIKc4XRV7a9f3j/MLhPnfzXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022