UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pllaJR8+WIqqKWk/jGM9TzE/sUEaaxKQcKyuFk7pU+U='
WHERE
key_id = 'c70585ba7fd9152ae3f2e19a6d286618f77bfe59af7de70b7fb5263e695c11ad'
AND (
token = 'pllaJR8+WIqqKWk/jGM9TzE/sUEaaxKQcKyuFk7pU+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)