UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N6VEHzHnHkpPZDDgv9vlpiKw/VUhJF2+7gDleTqsYOg='
WHERE
key_id = '92c385e7f94d5b883be36289e0dd45a5bf8c2c8c34ab66dd727b633bc482ba46'
AND (
token = 'N6VEHzHnHkpPZDDgv9vlpiKw/VUhJF2+7gDleTqsYOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)