UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yvSXv8gEQK/TazMVuL9MpcFeV+18y3xUKYxg4VEHnRQ=' 
WHERE 
  key_id = 'cdea5914458189622f44a928ed05df171a636a9345a83a58a02aea3f9e4113e4' 
  AND (
    token = 'yvSXv8gEQK/TazMVuL9MpcFeV+18y3xUKYxg4VEHnRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054