UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pk6QiuRH/6+E3IRMv07kKnMN0jON+u7BJO7ATLsekfc='
WHERE
key_id = '577bb994ab173c8037cb1992d68712789da5dac4e2acc4c187f0f56967a904f2'
AND (
token = 'pk6QiuRH/6+E3IRMv07kKnMN0jON+u7BJO7ATLsekfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)