UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UCO3SE3TEMQH+PuLBNGSVdkaQK03GtUR4x0ZsIoi/xA=' 
WHERE 
  key_id = '8bded19c85da41874b7509e082f52118167a9deb3f259bf7145b5502e9d5b32a' 
  AND (
    token = 'UCO3SE3TEMQH+PuLBNGSVdkaQK03GtUR4x0ZsIoi/xA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015