UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't5hKx+7Gl/MnRCZeNfoJd/kvQKXgVy+2GgANFETxNB0='
WHERE
key_id = '34b9779c1e0d3773d1a3885506b8cecdf60a9df77e9e1e65c41679551aebb364'
AND (
token = 't5hKx+7Gl/MnRCZeNfoJd/kvQKXgVy+2GgANFETxNB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)