UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TrZqK0Unl/2VdebB6R4DeGsI5u813FJjKH0cZTkOXlo=' 
WHERE 
  key_id = 'a1ba15c2693d5267dfb9288d6c684b103e7fb564eead8d0bd1270e0b7ed5edcb' 
  AND (
    token = 'TrZqK0Unl/2VdebB6R4DeGsI5u813FJjKH0cZTkOXlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063