UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A6uzyXV6tPDDeHZMOMoA+jLNRspUGPlsyN3xIoIqekw='
WHERE
key_id = '36f1f2de2dd04f89576365d993d93c89246eb1654c773ffcc18a9bd33516980c'
AND (
token = 'A6uzyXV6tPDDeHZMOMoA+jLNRspUGPlsyN3xIoIqekw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)