UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mmvdu9xwWtJR2WKObAANKlXYnVpU+TjJKD/CtgST060='
WHERE
key_id = 'bc4faff96b7a23dedca48a93375aea78b891a9a34c4759734c9da19b2f4fa375'
AND (
token = 'Mmvdu9xwWtJR2WKObAANKlXYnVpU+TjJKD/CtgST060='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)