UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NqOoNApzr6MDbW/Sgn73Skgdlu27OkHfvSg7lf2RHy8=' 
WHERE 
  key_id = '60bd774100adff4d4e574e6437114aaaeccfa53f31bff13e22ac56dc21f65add' 
  AND (
    token = 'NqOoNApzr6MDbW/Sgn73Skgdlu27OkHfvSg7lf2RHy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030