UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YwmFqnNz0PuRt9ocqcsYP14eBrpO1EAgASLOi9shBpM=' 
WHERE 
  key_id = '62925d96df691d0e78b586f65183e0206eaed094749afc0abe129b9a33e9b80a' 
  AND (
    token = 'YwmFqnNz0PuRt9ocqcsYP14eBrpO1EAgASLOi9shBpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054