UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9bpNsMPA/Pfz2+cd1o2I4RFKvw4IuoJfGmll0dZvw1s='
WHERE
key_id = 'b0994f8f780d3f09fbcf699a91f8c28e0379dd17829f50c1a329ca24978173ee'
AND (
token = '9bpNsMPA/Pfz2+cd1o2I4RFKvw4IuoJfGmll0dZvw1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)