UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Z6/YLjz6+jA4zfs7fs8/59i3ya7DVMmM+ukKWOEbQg=' 
WHERE 
  key_id = '4bcb87d946876369b928375dd463dbfb92ecab9a6e3170dd0ead692f33c7eef8' 
  AND (
    token = '6Z6/YLjz6+jA4zfs7fs8/59i3ya7DVMmM+ukKWOEbQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030