UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2KoVFbi/1lzgL6y2Jh8YA5BsWbVZ3MwmibylNoLLRjw='
WHERE
key_id = '6e76ebdb2bb990adb221a701b55d4b70f887d39445b2e24205246ac061db4f24'
AND (
token = '2KoVFbi/1lzgL6y2Jh8YA5BsWbVZ3MwmibylNoLLRjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)