UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uQit5O5/IY4qMXJesGWICHXNXWRLwrS2edxfQPd3IJA='
WHERE
key_id = '0367ed039d22fcca867e4b787ba428d7a8f780c08a5b8944f91f47fb850422fc'
AND (
token = 'uQit5O5/IY4qMXJesGWICHXNXWRLwrS2edxfQPd3IJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)