UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J1ObQ52g975cqFudhyi3i3cLd4TVRagQmtM+INFTmhg=' 
WHERE 
  key_id = '503b8e8d00ffceb8d3b4d3b8e8cb5c02a2c926e0912ebfec28d7e5efb6e5e7a2' 
  AND (
    token = 'J1ObQ52g975cqFudhyi3i3cLd4TVRagQmtM+INFTmhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018