UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lPjAWBZnAXNnf93CZkkcragdt/pbWt6YG3teO8IvMUI=' 
WHERE 
  key_id = 'ea26545ce818243312b5d4162846918862af1531bbab2ffe5a675be734b3192a' 
  AND (
    token = 'lPjAWBZnAXNnf93CZkkcragdt/pbWt6YG3teO8IvMUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025