UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QAlXSVDCd2NWvpHvoJyk7lGOcjLEdSmCw/hI75kNUSM='
WHERE
key_id = '8826f15f89fd2330c3704ee8c3a7f70ac56b3ddab5afed75440a4ee63c83130e'
AND (
token = 'QAlXSVDCd2NWvpHvoJyk7lGOcjLEdSmCw/hI75kNUSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)