UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XRrzkCHMPl2J1q4eqnmXH3jyPj4OBgJ5aRlAHuDeTss=' 
WHERE 
  key_id = '2e1c6606bdea4aed3e11eb2e73ead9fc3eec74fd1db1260d82c3b5816f01f2c9' 
  AND (
    token = 'XRrzkCHMPl2J1q4eqnmXH3jyPj4OBgJ5aRlAHuDeTss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046