UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9hQOm8IoMB6O+m9624xtU+x3gh+v2ZAd3Iv4qIGALDQ='
WHERE
key_id = 'e6a0b9ee3d276bb70e806e00bf66650f5d440b3871210e0fb0164e02ccc600be'
AND (
token = '9hQOm8IoMB6O+m9624xtU+x3gh+v2ZAd3Iv4qIGALDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)