UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qg2FU8celG3SeimkKy79kvBqqA5GvK1ElIJmpi/2B6I='
WHERE
key_id = '49555d8fccef03414a16a03669b19caa79afe6ab6c3fccd0b0814a2764723733'
AND (
token = 'qg2FU8celG3SeimkKy79kvBqqA5GvK1ElIJmpi/2B6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)