UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w8+bj8yvrgHYRN8Dcb7Rcu1fVsFX54wjC6/9I6SXjSg='
WHERE
key_id = 'c543fa1f6a347a1eaea539d8825a4acf8143046eabbb096ad9e3bc1aa5087278'
AND (
token = 'w8+bj8yvrgHYRN8Dcb7Rcu1fVsFX54wjC6/9I6SXjSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)