UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LJMNlplOY0qImbGIn+sfplkrLlvgGzRAsud5X7C0S5Q=' 
WHERE 
  key_id = '47198a49b4fc3dae69ef128c209573dbdf6a6f3afdc8578314131f92b9e00a8f' 
  AND (
    token = 'LJMNlplOY0qImbGIn+sfplkrLlvgGzRAsud5X7C0S5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051