UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jmy2dm+gcXhRTyu8CgVAmC9MomGiVZ/ToqrFuz7V1wM=' 
WHERE 
  key_id = 'eb937d5ca71a81f776cb51c811d7cd96ebbc15b238b11b74e109b5ddf9659927' 
  AND (
    token = 'jmy2dm+gcXhRTyu8CgVAmC9MomGiVZ/ToqrFuz7V1wM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032