UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R2dWAqwBTRWrOUGRHcgl0sBiaONzrlK7rPN/fExILKA='
WHERE
key_id = '8d3a4fb9dfede085778b3be36619cb59f8c45bd782bedecc9d29e7105dbc6e6e'
AND (
token = 'R2dWAqwBTRWrOUGRHcgl0sBiaONzrlK7rPN/fExILKA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)