UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CAwBzn5svnpWQbsqf2kk+Tr0qICn+9YYqGXohwQjKZg='
WHERE
key_id = '55b3701294aa794c4ea3a7ede287130ca9f88ea2783b76686134f10ec6e7c411'
AND (
token = 'CAwBzn5svnpWQbsqf2kk+Tr0qICn+9YYqGXohwQjKZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)