UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bxGlVMMYzej14U7e/A9WNJ6po75hT4BEImEV4AJ5JUU=' 
WHERE 
  key_id = '596d87a518a92205608482b8a0574a43604480fe176a8cfad513bf59085ad0d5' 
  AND (
    token = 'bxGlVMMYzej14U7e/A9WNJ6po75hT4BEImEV4AJ5JUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036