UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AN008j3QdqDenrIQztYhHRrwfkGfXwd2/i5YWm33A/E=' 
WHERE 
  key_id = '5c05d4672f06282a196e8f67d9fcf70881f1fd7325ec3043847e9bc24c10bb76' 
  AND (
    token = 'AN008j3QdqDenrIQztYhHRrwfkGfXwd2/i5YWm33A/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039