UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7PKOWGxeKtyhdW+msTIwUB/Td0LerDukcOqWCwmRidc=' 
WHERE 
  key_id = '57d41ab0ef6bb2d2f60d246dfd05f25d5900aff656ded4dccbec5844d255a092' 
  AND (
    token = '7PKOWGxeKtyhdW+msTIwUB/Td0LerDukcOqWCwmRidc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031