UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uFoyIxB49zJPu/yZxfiaTbehIhoUFGD0jLsw3qATWbA='
WHERE
key_id = '2f5c8b3927e3203357f6978bf59e26eab592c5f092020129a445eb33342d4db7'
AND (
token = 'uFoyIxB49zJPu/yZxfiaTbehIhoUFGD0jLsw3qATWbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)