UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U3jjs6aN3Vp8+bfYrEWt5MGMDyrHsEKzRClhz4kP6KI=' 
WHERE 
  key_id = '4294899c0c17ddd593501100699720efa1297c68b3344445db0fca91b6dfc2b6' 
  AND (
    token = 'U3jjs6aN3Vp8+bfYrEWt5MGMDyrHsEKzRClhz4kP6KI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025