UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uKpZAG2TdpTTkDb+cfzdO5diMv3oZrsF1t8kUuZd+ks='
WHERE
key_id = '98b697703e93ecbbd765b80c2d2dcba6e9f13d177f1b0b7ff96cf0fcf19b9f9b'
AND (
token = 'uKpZAG2TdpTTkDb+cfzdO5diMv3oZrsF1t8kUuZd+ks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)