UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tV3N+VfimKUmmKZ56WW0jhCLl5g+69q8J3PQHIHvzkI=' 
WHERE 
  key_id = '18955c3eedcb269697a06047fa65623e94095cfa30c39a44c45b301b8a893125' 
  AND (
    token = 'tV3N+VfimKUmmKZ56WW0jhCLl5g+69q8J3PQHIHvzkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036