UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uij7Fp9Wpui7TObfDUgKHCmq05hwvdH+Yx4PKeDn1C8='
WHERE
key_id = '58fd93598ba1502f9835be319aacc4c52f93daf722a174216e89825d3beb72f2'
AND (
token = 'Uij7Fp9Wpui7TObfDUgKHCmq05hwvdH+Yx4PKeDn1C8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)