UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V0a/G2pR7wSB8lxbUPfU8/rplJD5LCeclsePufZ9l1k='
WHERE
key_id = '84b475ce44ba948397534f1155784394aa12300d4b40c79ceaeac9b588dd54c2'
AND (
token = 'V0a/G2pR7wSB8lxbUPfU8/rplJD5LCeclsePufZ9l1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)