UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bp7sl3VjSMN4ooKjGya/j+RRVYZmhd796uqZq5HlCr0='
WHERE
key_id = '94730fc7bcf346bf21c403af72f536cde4b2eaf3e8f3a54e5a4d35d082038e8b'
AND (
token = 'Bp7sl3VjSMN4ooKjGya/j+RRVYZmhd796uqZq5HlCr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)