UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eqt8QUza8LD7Acf1zCL8xKZjP3zjkm2ghYThEp6MlYA=' 
WHERE 
  key_id = '5e2af2500375a2ad1eef02ef41bf21d14738ff6f16333565254d92ec445d3254' 
  AND (
    token = 'eqt8QUza8LD7Acf1zCL8xKZjP3zjkm2ghYThEp6MlYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054