UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p5PisqTLJ2Q0wGNz9xy0kjQ4ayM9/qBxVBpUP6uV3UY='
WHERE
key_id = '48ab9b22a75e5194ddcc7af33a5dee97bfe797d42ebac9222b1db84390ded54e'
AND (
token = 'p5PisqTLJ2Q0wGNz9xy0kjQ4ayM9/qBxVBpUP6uV3UY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)