UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UUCFJW+wN7RO5wqQ9SvbhjuGKriVljfhUd2RQpEFmlA='
WHERE
key_id = '698e0ab80216a7a1b2eb179798eef954eb0f37d014d2210ede5b755c1f545463'
AND (
token = 'UUCFJW+wN7RO5wqQ9SvbhjuGKriVljfhUd2RQpEFmlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)