UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6HaOZMj99EjHOy1KkP8v8OYhOZ01oP9ZXTbIzHwkeVA=' 
WHERE 
  key_id = '3c18d4b0f639d12d058ea9187d38f2bd8938005fa3732f343a8f9e26cfad481b' 
  AND (
    token = '6HaOZMj99EjHOy1KkP8v8OYhOZ01oP9ZXTbIzHwkeVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021