UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ll8qYvLxq7Ig1dcbqk7gUjrc47wNpfBSHBdU7NDZun4='
WHERE
key_id = '224a41ffb804007a6d5e50d8f744e90160f623b61ad85528bdbff27acb52128a'
AND (
token = 'Ll8qYvLxq7Ig1dcbqk7gUjrc47wNpfBSHBdU7NDZun4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)