UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QRUT/V/7qsmCDqopgBevusWNB2fIzlinXEvlEz1gRYE='
WHERE
key_id = 'f636b7863c70edc1199218b2f4014d8f301260024e3268dc8de2a1aff3e36119'
AND (
token = 'QRUT/V/7qsmCDqopgBevusWNB2fIzlinXEvlEz1gRYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)