UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yoZLoCEk8YxqPWOccfPw3St0+LeCQwEo1KbPgKp9d8g=' 
WHERE 
  key_id = '54a60a3c4db4370c5669abc76c9a8f4fcc0007ccba7dbeab2d02d6f2fb0975b4' 
  AND (
    token = 'yoZLoCEk8YxqPWOccfPw3St0+LeCQwEo1KbPgKp9d8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032