UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5F1ByZdMts/PDupjl/jh4U2VmkHYeoZSyygBzutNE84='
WHERE
key_id = '8c27f0793c81f4a7bc789d67849cfec5e95b9ed3342da6163b7923d1d5f71f10'
AND (
token = '5F1ByZdMts/PDupjl/jh4U2VmkHYeoZSyygBzutNE84='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)