UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6F68rdsW08LNaISgLj7VsWMwIwgHuixQNEsGbzB0b28='
WHERE
key_id = '18ef0de4dcdaee972d09b214da2f22ac2469b18b70238dac1a3e861c29ab1e98'
AND (
token = '6F68rdsW08LNaISgLj7VsWMwIwgHuixQNEsGbzB0b28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)