UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jQkhYv00mSC+SVZkZ/6m1ds7IY4v8kBA720Q6KIwQGY='
WHERE
key_id = '68ca7916ef5a7a27363fd06eb4c5643b213a222624fc0e745d3eaa777d1a871c'
AND (
token = 'jQkhYv00mSC+SVZkZ/6m1ds7IY4v8kBA720Q6KIwQGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)