UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OFPyzTub6UwxONNpxOLKnsyAZxUJ8+X+gnnrAQOf1XI='
WHERE
key_id = '013e4749e54ef404e6575164897460823075aac73fcfb735d6e4a53505b645fc'
AND (
token = 'OFPyzTub6UwxONNpxOLKnsyAZxUJ8+X+gnnrAQOf1XI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)