UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PgLLr/txp2WZMzfumSwj9OSA4Vp0e/n3yC5oW3QivMo='
WHERE
key_id = 'b8e114f7e473eb54bfc1422362b9500222a4b1307c5522781e509183c6dbba45'
AND (
token = 'PgLLr/txp2WZMzfumSwj9OSA4Vp0e/n3yC5oW3QivMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)