UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lHvhyrBfdLMiIGA4l5+2PBNhyvY9+1yPwpSZ6P769dg='
WHERE
key_id = 'b861783bcd995f64d7c5bcc9c9c3041f1f58d60deb0cfb7a54f0d1633673606b'
AND (
token = 'lHvhyrBfdLMiIGA4l5+2PBNhyvY9+1yPwpSZ6P769dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)