UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3EBmBteBNl+HrdgcFfSF13+3s8MUiAXra3ZqUBoNtZs=' 
WHERE 
  key_id = 'edaf24712be5e2aecf1e607393b3bd30cdcf9867c6e89f7ddb7bc2dbef6dfb8e' 
  AND (
    token = '3EBmBteBNl+HrdgcFfSF13+3s8MUiAXra3ZqUBoNtZs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00114