UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cccFu9kIYM9DEXHiiXjX7R3rURO3gQn3DXXTOvbiT0s=' 
WHERE 
  key_id = 'a33b06f0a9a618258cdae0781fa0458bb135118c5ff1850b3adc5b4b7c557a8d' 
  AND (
    token = 'cccFu9kIYM9DEXHiiXjX7R3rURO3gQn3DXXTOvbiT0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015