UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hVOzshiXeURTRQWUGrk/O9VQV6OgbdHnFKYjWfJ5+oE=' 
WHERE 
  key_id = '70931e6a8d6668cc04c973ec99fa59f9a19300df4b20ff684ddf388b80593877' 
  AND (
    token = 'hVOzshiXeURTRQWUGrk/O9VQV6OgbdHnFKYjWfJ5+oE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039