UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '63kZttdstbbqOJbmZ27yNohjYh0u3t64AyB5WCHzMT0=' 
WHERE 
  key_id = '585201a16bf4cbb92ccee64428e96210e7458464581a7d8f6dd701365947c3b8' 
  AND (
    token = '63kZttdstbbqOJbmZ27yNohjYh0u3t64AyB5WCHzMT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041