UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9RwqUNRNy9CjCUKWcd09zKNwZbGT5+/comTgCopz0ow='
WHERE
key_id = '069c281570d28bb34e14d500775c1f8d67b373f65e424a106e788b9d61f259ee'
AND (
token = '9RwqUNRNy9CjCUKWcd09zKNwZbGT5+/comTgCopz0ow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)