UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QnmrjsxCPrCR7eTmBEgqPS4U5Cc2ge/2E1Id0bBqSBI=' 
WHERE 
  key_id = '4dff704f60967c0fbfe127b2edf93f46f56e00cf967350ce6bfe1199089ec860' 
  AND (
    token = 'QnmrjsxCPrCR7eTmBEgqPS4U5Cc2ge/2E1Id0bBqSBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031