UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NCy/EzvxG0myPmOVNgrnJVSkUB/gUyHOatfAKXHizM8='
WHERE
key_id = '6fec842c17c6d424db3dcaef90de502b5c537a75f9fc6a583e19913d74ac7bd2'
AND (
token = 'NCy/EzvxG0myPmOVNgrnJVSkUB/gUyHOatfAKXHizM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)