UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jh61VcD+4zT5+cC9V5WlijENOrk59vcJL55ZddKoU8s=' 
WHERE 
  key_id = '8bbac6d41bc96e981e3a04232d6ce3f0053afe6c9338688706e54051ec2e29fe' 
  AND (
    token = 'Jh61VcD+4zT5+cC9V5WlijENOrk59vcJL55ZddKoU8s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00107