UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ut43Hqckvi0CwROu1JFrQNjUojG4UJARMUg95T/QHN0=' 
WHERE 
  key_id = '6fa5ec609c866f9e51d10ffe68b072b9d111bf988d593f9ad4ba1504ec819323' 
  AND (
    token = 'Ut43Hqckvi0CwROu1JFrQNjUojG4UJARMUg95T/QHN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032