UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DMoCz1kCM6jOrJjy90D6eqo6hjKsiw0bQW4skU7/588='
WHERE
key_id = '751411a63c03533847c27c941a1311f3ed151376bc2a23b2667a3f03fc9ca1f1'
AND (
token = 'DMoCz1kCM6jOrJjy90D6eqo6hjKsiw0bQW4skU7/588='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)